/*
 * @Author: your name
 * @Date: 2021-12-22 14:19:25
 * @LastEditTime: 2021-12-30 11:39:09
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * 
 * @FilePath: \xy-web-xiaoxi\src\views\train\js\formatter.js
 */

// 与我相关的状态替换
export function concern_me_formatter(row) {
  const array = row.data || []
  array.forEach((item) => {
    if (item.status == 0) {
      item.status = '未开始'
      item.isStatus = 0
    } else if (item.status == 1) {
      item.status = '进行中'
      item.isStatus = 1
    } else if (item.status == 2) {
      item.status = '已完成'
      item.isStatus = 2
    } else {
      item.status = '已过期'
      item.isStatus = 3
    }
    item.value = item.label
    return item
  })
  console.log(array,'4848484848');
  return array
}

// 在线答题
export function answer_formatter(row) {
  const array = row || []
  array.forEach(item => {
    if (item.type == 0) {
      item.type = '固定试卷'
    } else {
      item.type = '随机试卷'
    }
    return item
  })
  return array
}
